﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Diagnostics;

    class ProcessKiller
    {
        [DllImport("kernel32.dll", EntryPoint = "AllocConsole", SetLastError = true, CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
        private static extern int AllocConsole();

        public void ShowConsole()
        {
            AllocConsole();
            Console.WriteLine("Type name of the process you want to kill:");
            string processName = Console.ReadLine();
            processName = processName.ToLower();
            foreach (Process process in Process.GetProcesses())
            {
                string processString = process.ProcessName.ToLower();
                if (processString.Contains(processName))
                {
                    process.Kill();
                }
            }
        }
    }

